<script>
function url(){
	 location.href="http://www.baidu.com/";
	}
function abc(){
 var name=document.getElementById('search_key');
 name.className="ipt12";
}
function edf(){
 var name=document.getElementById('pl_key');
 name.className="ipt33";
}
function cc(x){
 var name=document.getElementById("con_five_"+x);
 var list=document.getElementById("five"+x);
 name.style.display="none";
 list.className="";
}
function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}
    function showInfos(types,infos,contentId){
      $.ajax({type: "POST",url: "<?php echo url_for('user/turninfos') ?>",data: "userEdit="+types+"&userload="+infos+"&contentId="+contentId,
                 success: infoResult,error:onfail});
    }
    function onfail(x,e){
        alert("连接失败");
        return false;}
    function infoResult(msg){
        $("#infos").html(msg);
    }
    function logout(){
        $.ajax({type: "POST",url: "<?php echo url_for('other/JQuery') ?>",data: "random="+Math.random()+"&submitflag=logout",
            success: logoutResult,
            error:onfail});
    }
    function logoutResult(msg){
        if(msg=='ok')
        {
            window.location.href="<?php echo url_for('general/index')?>";
        }
    }

    function addinfos(types,infos,contentI){
       $.ajax({type: "POST",url: "<?php echo url_for('user/editinfos') ?>",data: "userEdit="+types+"&userload="+infos+"&contentId="+contentI,
                 success: infoResult,error:onfail});
    }
</script>
<?php use_helper("users");?>
  <div class="main">
    <?php @include_component("system","menuNavigator",array("type"=>7,"cssStr"=>"address_tit2")) ;?>
    <div class="userInfo_box">
		    <div class="user_box_l">
			   <p style="margin-top:20px;"><a href="javascript:showInfos(1,1)">更改密码</a></p>
			   <p><a href="javascript:showInfos(1,2)">个人信息修改</a></p>
			   <p><a href="javascript:showInfos(1,3)">修改头像</a></p>
			   <p><a href="javascript:showInfos(1,4)">相册管理</a></p>
               <p><a href="javascript:logout()">退出登录</a></p>
			</div>
		<!--左侧结束-->
		<div class="userInfo_box_r">
		    <div class="user_info user_info2 user_info3">
			     <div class="user_info_l"><img src="<?php echo fileExist($avatar); ?>" /></div>
				 <div class="user_info_r" >
				    <ul>
					   <li><b>昵称：<var><?php echo $nickname?></var></b><font><a href="javascript:showInfos(1,6);">我的基本资料</a></font></li>
					   <li>最后在线时间：<?php echo (empty($last_survey_time))?"本次是第一次登陆":date('Y-m-d H:i:s',strtotime($last_survey_time)) ?></li>
					</ul>
				 </div>
			  </div>
			<!--结束-->
            <div id="infos">
            <?php @include_component('user','userinfo') ?>
            </div>
		</div>
    </div>
	</div>
<?php
if($sf_request->getParameter("show")>0)
    {
        echo "<script>showInfos(1,".$sf_request->getParameter("show").")</script>";
    }
if($sf_request->getParameter("pho")>0)
    {
        echo "<script>showInfos(1,5,".$sf_request->getParameter("pho").")</script>";
    }
if(1==$sf_request->getParameter("res"))
    echo "<script>alert('修改成功！')</script>";
else if(2==$sf_request->getParameter("res"))
    echo "<script>alert('修改失败！')</script>";
?>